package model;

import java.util.LinkedList;

/**
 * Created with IntelliJ IDEA.
 * User: Student
 * Date: 29/11/12
 * Time: 16:08
 * To change this template use File | Settings | File Templates.
 */
public class Backlog implements TaskList {

    private LinkedList<Task> backlogTaskList;

    public Backlog() {
        this.backlogTaskList = new LinkedList<Task>();
        initializeList();
    }

    public void addTask(Task backlogTask) {
        this.backlogTaskList.add(backlogTask);
    }

    public Task removeTask() {
        return this.backlogTaskList.removeFirst();
    }

    public int numberOfTasks() {
        return this.backlogTaskList.size();
    }

    public LinkedList<Task> getTaskList() {
        return this.backlogTaskList;
    }

    public Task getTasksByPriority(int priority) {
        return this.backlogTaskList.get(priority);
    }

    private void initializeList() {
        this.backlogTaskList.add(new WorkTask(1));
        this.backlogTaskList.add(new WorkTask(1));
        this.backlogTaskList.add(new WorkTask(3));
        this.backlogTaskList.add(new WorkTask(2));
    }
}
